import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import mine from '../views/mine.vue'
import shopcar from '../views/shopcar.vue'
import login from '../views/login.vue'
import register from '../views/register.vue'
import like from '../views/mine/like.vue'
import jumpsearch from '../components/home/jumpsearch.vue'
import recommendabout from '../views/recommendabout.vue'

Vue.use(VueRouter)

const routes = [
	{
		path: '/',
		name: 'Home',
		component: Home
	},
	{
		path: '/about',
		name: 'About',
		component: function () 
		{
			return import('../views/About.vue')
		}
	},
	{
		path: '/shopcar',
		name: 'shopcar',
		component: shopcar
	},
	{
		path: '/mine',
		name: 'mine',
		component: mine
	},
	{
		path: '/jumpsearch',
		name: 'jumpsearch',
		component: jumpsearch
	},
	{
		path: '/recommendabout',
		name: 'recommendabout',
		component: recommendabout
	},
	{
		path: '/mac',
		name: 'mac',
		component: function () 
		{
			return import('../views/classifyabout/mac.vue')
		}
	},
	{
		path: '/ipad',
		name: 'ipad',
		component: function () 
		{
			return import('../views/classifyabout/ipad.vue')
		}
	},
	{
		path: '/iphone',
		name: 'iphone',
		component: function () 
		{
			return import('../views/classifyabout/iphone.vue')
		}
	},
	{
		path: '/watch',
		name: 'watch',
		component: function () 
		{
			return import('../views/classifyabout/watch.vue')
		}
	},
	{
		path: '/music',
		name: 'music',
		component: function () 
		{
			return import('../views/classifyabout/music.vue')
		}
	},
	{
		path: '/part',
		name: 'part',
		component: function () 
		{
			return import('../views/classifyabout/part.vue')
		}
	},
	{
		path: '/login',
		name: 'login',
		component: login
	},
	{
		path: '/register',
		name: 'register',
		component: register
	},
	{
		path: '/like',
		name: 'like',
		component: like
	},
]

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
